#ifndef IA_H
#define IA_H


#include <string>
#include <vector>


#include "base/StateManager.h"
#include "base/State.h"

#include "CreatureObject.h"

#include "Target.h"

class CreatureObject;

class IAState : public State
{
    public:
        IAState(){m_parentCreature=0;};
        virtual ~IAState(){};


    virtual void enter()=0;
	virtual void exit()=0;
	virtual bool pause()=0;
	virtual void resume()=0;
	virtual void update(double timeSinceLastFrame)=0;

	void setParentCreature(CreatureObject* _parentCreature){m_parentCreature=_parentCreature;};


Target * getTarget(){return &m_target;};

    protected:
        CreatureObject* m_parentCreature;
        Target m_target;

    private:


};





class CreatureObject;

class IA : public StateManager
{
    public:

/*
friend class IAStateExplore;
friend class IAStateBring;
*/
        enum STATE
    {
       STA_PASSIVE =1<<0,
       STA_EXPLORE =1<<1,
       STA_FIGHT =1<<2,
       STA_BRING =1<<3,
       STA_COUNT = 4
    };





        IA(CreatureObject* _parent);
        virtual ~IA();


    bool isActive(){return m_isActive;};
    void setActive(bool _val){m_isActive = _val;};

    virtual void enter();
	virtual void exit();
	virtual void update(double timeSinceLastFrame);

//	IAState* createStates();
	IAState* createState(STATE _state);
//	IAState* getState(STATE _state);


STATE getActiveState();

    protected:

    bool m_isActive;
    CreatureObject* m_parent;

 //   std::map<STATE, IAState*> m_tabStates;




    private:
};

#endif // IA_H
